import React, {useState} from 'react'
import Taro from '@tarojs/taro'
import { AtIcon } from 'taro-ui'
import "taro-ui/dist/style/components/icon.scss";
import { View ,Text, Image, ScrollView, prevState } from '@tarojs/components'
import './index.less'


export default function Index() {
   
  const [isSelect,setIsSelect]=useState(false)
  // 收藏星星的点击
  const selectFn=(e)=>{
     console.log(e,'点击了收藏星星');
     setIsSelect(!isSelect)  
  }

  const gophysical=()=>{
      Taro.navigateTo({
          url:'../../pages/HXM/MineBooked/MineBooked',
      })
  }

  const goreport=()=>{
    Taro.navigateTo({
        url:'../../pages/HXM/MyReport/MyReport',
    })
  }

  const go=()=>{
    Taro.navigateTo({
      url:'../projectInf/ProjectInf'
    })
  }

  return (
    <View className="box">
        <View className="box-1">
            <navigator url="/pages/ItemClassify/ItemClassify">
            <View className="box-1-1">
              <View>
                <Image src="https://img1.baidu.com/it/u=4118280267,4271263127&fm=253&fmt=auto&app=120&f=PNG?w=171&h=165"></Image>
              </View>
              <View>
                <View>我要体检</View>
                <View className="line">机构套餐 随心选择</View>
              </View>
            </View>
            </navigator>
            <View className="box-1-1" onClick={gophysical.bind(this)}>
              <View>
                <Image src="https://img1.baidu.com/it/u=4118280267,4271263127&fm=253&fmt=auto&app=120&f=PNG?w=171&h=165"></Image>
              </View>
              <View>
                <View>我的预约</View>
                <View className="line">按需加项 更改日期</View>
              </View>
            </View>
              <View className="box-1-1" onClick={goreport.bind(this)}>
                <View>
                  <Image src="https://img1.baidu.com/it/u=4118280267,4271263127&fm=253&fmt=auto&app=120&f=PNG?w=171&h=165"></Image>
                </View>
                <View>
                  <View>我的报告</View>
                  <View className="line">报告管理 趋势分析</View>
                </View>
              </View>
            <View className="box-1-1">
              <View>
                <Image src="https://img1.baidu.com/it/u=4118280267,4271263127&fm=253&fmt=auto&app=120&f=PNG?w=171&h=165"></Image>
              </View>
              <View>
                <View>报告解读</View>
                <View className="line">在线医生 答疑解惑</View>
              </View>
            </View>
        </View>
        <View className="box-2">
          <Text className="line1">推荐机构</Text>
          <navigator open-type="switchTab" url="/pages/organization/Organization"><Text >更多</Text></navigator>
        </View>
        <View className="box-3">
          <ScrollView enable-flex scrollX className="scrollBox1">
            <navigator url="/pages/Organ/Organ">
            <View className="item">
              <Image src='https://gss0.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/w=580/sign=567d0263d9c451daf6f60ce386fc52a5/2b138e529822720e415b78c77fcb0a46f31fab5e.jpg'>
              </Image>
              <View className="line1">南方医科大学附属第三医院</View>
              <View className="line2">100个套餐</View>
            </View>
            </navigator>
            <View className="item">
              <Image src='https://gss0.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/w=580/sign=567d0263d9c451daf6f60ce386fc52a5/2b138e529822720e415b78c77fcb0a46f31fab5e.jpg'>
              </Image>
              <View className="line1">南方医科大学附属第三医院</View>
              <View className="line2">100个套餐</View>
            </View>
            <View className="item">
              <Image src='https://gss0.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/w=580/sign=567d0263d9c451daf6f60ce386fc52a5/2b138e529822720e415b78c77fcb0a46f31fab5e.jpg'>
              </Image>
              <View className="line1">南方医科大学附属第三医院</View>
              <View className="line2">100个套餐</View>
            </View>
            <View className="item">
              <Image src='https://gss0.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/w=580/sign=567d0263d9c451daf6f60ce386fc52a5/2b138e529822720e415b78c77fcb0a46f31fab5e.jpg'>
              </Image>
              <View className="line1">南方医科大学附属第三医院</View>
              <View className="line2">100个套餐</View>
            </View>
            <View className="item">
              <Image src='https://gss0.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/w=580/sign=567d0263d9c451daf6f60ce386fc52a5/2b138e529822720e415b78c77fcb0a46f31fab5e.jpg'>
              </Image>
              <View className="line1">南方医科大学附属第三医院</View>
              <View className="line2">100个套餐</View>
            </View>
          </ScrollView>
        </View>
        <View className="box-4">
          <Text className="line1">推荐套餐</Text>
          <navigator open-type="switchTab" url="/pages/project/Project"><Text>更多</Text></navigator>
        </View>
        <View className="box-5">
          <ScrollView enable-flex scrollX className="scrollBox2">
            <View className="item" onClick={go}>
              <View onClick={e=>e.stopPropagation()}>
                <AtIcon onClick={selectFn} className="icon" value={isSelect?'star-2':'star'} size='35' color='yellow'></AtIcon>
              </View>
              <Image src='https://gss0.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/w=580/sign=567d0263d9c451daf6f60ce386fc52a5/2b138e529822720e415b78c77fcb0a46f31fab5e.jpg'>
              </Image>
              <View>男士体检套餐</View>
              <View className="line2">南方医科大学附属第三医院</View>
              <View><Text>￥998</Text><Text className="oldPrice">￥1200</Text></View>
            </View>
            <View className="item">
              <Image src='https://gss0.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/w=580/sign=567d0263d9c451daf6f60ce386fc52a5/2b138e529822720e415b78c77fcb0a46f31fab5e.jpg'>
              </Image>
              <View>男士体检套餐</View>
              <View className="line2">南方医科大学附属第三医院</View>
              <View><Text>￥998</Text><Text className="oldPrice">￥1200</Text></View>
            </View>
            <View className="item">
              <Image src='https://gss0.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/w=580/sign=567d0263d9c451daf6f60ce386fc52a5/2b138e529822720e415b78c77fcb0a46f31fab5e.jpg'>
              </Image>
              <View>男士体检套餐</View>
              <View className="line2">南方医科大学附属第三医院</View>
              <View><Text>￥998</Text><Text className="oldPrice">￥1200</Text></View>
            </View>
            <View className="item">
              <Image src='https://gss0.baidu.com/70cFfyinKgQFm2e88IuM_a/forum/w=580/sign=567d0263d9c451daf6f60ce386fc52a5/2b138e529822720e415b78c77fcb0a46f31fab5e.jpg'>
              </Image>
              <View>男士体检套餐</View>
              <View className="line2">南方医科大学附属第三医院</View>
              <View><Text>￥998</Text><Text className="oldPrice">￥1200</Text></View>
            </View>
          </ScrollView>
        </View>
    </View>
  )
}
